package com.example.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-10-15
 * Time:21:05
 */
@Controller
@ResponseBody
@Slf4j
public class UserController {
//    //1、得到日志对象,设置当前类为参数
//    private final static Logger log = LoggerFactory.getLogger(UserController.class);

    @RequestMapping("/sayhi")
    public void sayHi(){
        //2、使用日志对象提供的方法打印日志
        log.trace("我是 trace");
        log.debug("我是 debug");
        log.info("我是 info");
        log.warn("我是 warn");
        log.error("我是 error");
    }
}
